<template>
    <div class="child">
      <h2>我是子组件</h2>
      <button @click="sendToParent">点击传值给父组件</button>
    </div>
  </template>
  
  <script>
  export default {
    name: "Child",
    methods: {
      sendToParent() {
        this.$emit("change", "这是来自子组件的消息");
      }
    }
  }
  </script>
  
  <style scoped>
  .child {
    padding: 10px;
    border: 1px solid #ccc;
  }
  </style>